package com.campus.mapper;

import com.campus.pojo.po.Major;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MajorMapper {
    /**
     * 通过院系id查询专业信息
     *
     * @param id
     * @return
     */
    @Select("select id, name, faculty_id from major where faculty_id = #{id}")
    List<Major> getMajorByFacultyId(Integer id);

    /**
     * 查询所有专业信息
     * @return
     */
    @Select("select id, name, faculty_id from major")
    List<Major> getMajorAll();
}
